package org.demo.controller;

import lombok.extern.slf4j.Slf4j;
import org.demo.entity.Order;
import org.demo.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    /**
     * 路径： /order/101
     *
     * @param id 订单id
     * @return 订单信息
     */
    @GetMapping("/{id}")
    public Order queryById(@PathVariable("id") Long id) {
        return orderService.queryById(id);
    }
}

